home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ DOC ShellEx.xpl < prev    next >
Text File  |  2001-01-21  |  2KB  |  89 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 5.0"
  2. "TYPE"="3"
  3. "COUNT"="4"
  4. "UIPATH"="Appearance\Files&Folders\Files"
  5. "NAME"="*.DOC Context Menu"
  6. "LANGUAGE"="VBScript"
  7. "TEXT 1"="(1) Name"
  8. "TEXT 2"="(1) Command"
  9. "TEXT 3"="(2) Name"
  10. "TEXT 4"="(2) Command"
  11. "DATA 1"="  "
  12. "DATA 2"="Executables (*.exe)|*.exe"
  13. "DATA 3"="   "
  14. "DATA 4"="Executables (*.exe)|*.exe"
  15. "DESCRIPTION 1"="The extension DOC (*.DOC) is used by many programs such as Microsoft Word and WordPad and others as well."
  16. "DESCRIPTION 2"="This plug-in will allow you to specify which program(s) you wish to use when opening files with the .DOC extension."
  17. "DESCRIPTION 3"="To remove the command(s), clear both the "Name" and the "Command" field and press "Apply"."
  18. "COMMENT 1"=" "
  19. "VERSION"="1.13"
  20. "AUTHOR"="Xteq Systems"
  21. "CONTACTURL"="http://www.xteq.com"
  22. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  23.  
  24. 'Declaration of some constants
  25. sPathBase="HKCR\.doc\@"
  26. sPath1="" 'set later through code
  27. sPath2="" 'dito
  28. sCMD="Command\@" '*** this is always the same
  29.  
  30. 'Called when the Plugin is started
  31. SUB Plugin_Initialize
  32.  ' First check where this stuff goes to
  33.  s=RegReadValue(sPathBase)
  34.  if IsEmpty(s)=true then
  35.     'nothing found - we'll stick with .DOC
  36.     s=".doc"
  37.  end if
  38.  sPath1="HKCR\" & s & "\Shell\XQXSETCMD1\"
  39.  sPath2="HKCR\" & s & "\Shell\XQXSETCMD2\"
  40.  
  41.  
  42.  Call ReadStuff(sPath1,1)
  43.  Call ReadStuff(sPath2,3)
  44. END SUB
  45.  
  46. 'Called when the Plugin should validate the Data the user has entered
  47. SUB Plugin_CheckData(ElementIndex)
  48. END SUB
  49.  
  50. 'Called when the Plugin should apply the changes
  51. SUB Plugin_Apply(ElementIndex,ElementSubIndex)
  52.  Call WriteStuff(sPath1,1)
  53.  Call WriteStuff(sPath2,3)
  54. END SUB
  55.  
  56. 'Called when the Plugin is about to be removed from memory
  57. SUB Plugin_Terminate
  58. END SUB
  59.  
  60. 'User defined SUB's
  61. SUB ReadStuff(Path,UIStart)
  62.  s=RegReadValue(Path & sCMD)
  63.  if len(s)>0 then
  64.     s=RegReadValue(Path & "@")
  65.     SetUIElement UIStart,s
  66.  
  67.     s=RegReadValue(Path & sCMD)
  68.     SetUIElement UIStart+1,s
  69.  end if
  70.  
  71. END SUB
  72.  
  73. SUB WriteStuff(Path,UIStart)
  74.  s1=GetUIElement(UIStart)
  75.  s2=GetUIElement(UIStart+1)
  76.  
  77.  
  78.  if len(s1)>0 or len(s2)>0 then
  79.     Call RegWriteValue(Path & sCMD,s2,1)
  80.     Call RegWriteValue(Path & "@",s1,1)
  81.  else
  82.   if IsEmpty(RegReadValue(Path & sCMD))=false then
  83.      Call RegDeletePath(Path & "Command")
  84.      Call RegDeletePath(Path)
  85.   end if
  86.  end if
  87.  
  88. END SUB
  89.